package mh.entity.spell;

import static mh.entity.DamageEffectEnum.*;
import static mh.entity.spell.EnumSpellType.*;

import java.util.Hashtable;

import mh.entity.DamageEffectEnum;

public enum EnumSpells{

	// SPELL_S_NAME ( VELOCITY - HASHTABLE(EFFECT - VALUE) - spellset - positionInSet - BLOCKABLE - canINTERACT )
	AVADA_KEDAVRA(UNFORGIVABLE_CURSE,new DamageEffectEnum[] { KILL },new int[] { 100 },0,0,0,false,false),
	ACCIO(SPECIAL,new DamageEffectEnum[] { MAGNET },new int[] { 100 },0,0,0,true,true);

	private EnumSpellType							type;
	private int										velocity;
	private Hashtable<DamageEffectEnum, Integer>	effects;
	private boolean									blockable;
	private boolean									interact;

	private EnumSpells(EnumSpellType type, DamageEffectEnum[] fx, int[] values, int v, int spellSet, int posInSet, boolean b, boolean interact) {
		if (fx.length != values.length) {
			throw new RuntimeException("Arguments number don't match");
		}
		this.type = type;
		for (int i = 0; i < fx.length; i++) {
			this.effects.put(fx[i], values[i]);
		}
		this.velocity = v;
		this.blockable = b;
		this.interact = interact;
	}

	/**
	 * @return The type of this spell
	 */
	public EnumSpellType getType() {
		return this.type;
	}

	/**
	 * @return the base velocity of this spell
	 */
	public int getVelocity() {
		return this.velocity;
	}

	/**
	 * @return The Hashtable of all the effects this spell has
	 */
	public Hashtable<DamageEffectEnum, Integer> getEffects() {
		return this.effects;
	}

	/**
	 * @return True if can be blocked by a defense charm
	 */
	public boolean isBlockable() {
		return this.blockable;
	}

	/**
	 * @return true if the spell can interact with other spells
	 */
	public boolean canInteract() {
		return this.interact;
	}
}
